Auto merge of #3583 - alexcrichton:fix-tags, r=brson
authorbors <bors@rust-lang.org>
Wed, 8 Feb 2017 01:03:17 +0000 (01:03 +0000)
committerbors <bors@rust-lang.org>
Wed, 8 Feb 2017 01:03:17 +0000 (01:03 +0000)
commitc45c2193d0b4a86f7b782c58a19a43cbb9ce4fe0
treeb0cbf3a054623808f537b3cbf1a6cebaecfbac50
parentfa1b12aa7ae188c430108383e570119328b5a023
parentc0cc8ffe24ff795b9d0d5ca9da57485049fd3c97
Auto merge of #3583 - alexcrichton:fix-tags, r=brson

Handle `rev` being a `tag`

Previously if a rev was specified as a tag then we'd trip an assertion because
resetting to that tag would reset to the tag that the commit pointed to, which
would then cause the head id of the repo to be different than what we thought it
was.

Instead, we handle the case where a `rev` specification is a tag explicitly by
using the tag's target id as the revision that we're going to check out, not the
id of the tag itself.

Closes #3580
src/cargo/sources/git/utils.rs